// 作业一、 九九乘法表
for (let i=1;i<10;i++) {
    line = ''
    for (let j=1;j<=i;j++) {
        line += `${j} * ${i} = ${j*i} `
    }
    console.log(line);
}


console.log('~~~~~~~~~~~~~~~~~~~~~~~~~'); // 分界线


// 作业二、 排序
let arr = [ 9, 7, 12, 3, 1, 8, 15 ,20, 31]

for (let i = 0; i < arr.length; i ++) {
    for (let j = i + 1; j < arr.length; j ++) {
      if (arr[j] < arr[i]) {
        let tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp;
      }
    }
  }
  
console.log(arr);
